package com.wanma.tcp;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class UdpClient {
	public static void main(String[] args) throws IOException {
		System.out.println("udp 客户端发送数据");
		DatagramSocket datagramSocket = new DatagramSocket();
		String str = "客户端发送数据。。。。。。";
		byte[] strByte = str.getBytes();
		DatagramPacket dp = new DatagramPacket(strByte, strByte.length,InetAddress.getByName("192.168.1.191"), 8080);
		datagramSocket.send(dp);
		datagramSocket.close();
	}
}
